package com.syni.mdd.sjb.common.datatreaure.controller.protect.dataTreasure.saasminapp;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckUserIdentity;
import com.syni.mdd.sjb.common.datatreaure.controller.BaseController;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.databank.MemberRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.saasminapp.business.UpdateBusinessInfoRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.saasminapp.business.UpdateShareRqVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.saasminapp.config.StoreIdVo;
import com.syni.mdd.sjb.common.datatreaure.entity.vo.rq.saasminapp.order.*;
import com.syni.mdd.sjb.common.datatreaure.service.databank.saasminapp.MinBusinessService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
@RequestMapping("/minApp/business")
public class MinBusinessController extends BaseController {

    @Autowired
    private MinBusinessService minBusinessService;

    @PostMapping("/getServiceInfo")
    @ApiOperation(value = "获取当前店铺服务信息")
    @CheckUserIdentity
    public Map<String,Object> getServiceInfo(@RequestBody MemberRqVo memberRqVo){
        return minBusinessService.getServiceInfo(memberRqVo);
    }

    @PostMapping("/updateSharing")
    @ApiOperation(value = "更新分帐状态")
    @CheckUserIdentity
    public Map<String,Object> updateSharing(@RequestBody UpdateShareRqVo updateShareRqVo){
        return minBusinessService.updateSharing(updateShareRqVo);
    }

    @PostMapping("/getStoreById")
    @ApiOperation(value = "获取店铺信息")
    @CheckUserIdentity
    public Map<String,Object> getStoreById(@RequestBody StoreIdVo storeIdVo){
        return minBusinessService.getStoreById(storeIdVo);
    }

//    @PostMapping("/getStoreByIdv2")
//    @ApiOperation(value = "获取店铺信息")
//    @CheckUserIdentity
//    public Map<String,Object> getStoreByIdv2(@RequestBody StoreIdVo storeIdVo){
//        return minBusinessService.getStoreByIdv2(storeIdVo);
//    }

    @PostMapping("/updateBusinessInfo")
    @ApiOperation(value = "更新店铺信息")
    @CheckUserIdentity
    public Map<String,Object> updateBusinessInfo(@RequestBody UpdateBusinessInfoRqVo updateBusinessInfoRqVo){
        return minBusinessService.updateBusinessInfo(updateBusinessInfoRqVo);
    }


}
